import types
import constants

def getSignature(returnType, methodType=constants.INSTANCE, argumentTypes=None):    
    ret = ""
    
    #RETURN TYPE
    if returnType == constants.VOID:
        ret += "v"
    elif returnType == constants.INTEGER:
        ret += "i"
    elif returnType == constants.FLOAT:
        ret += "f"
    elif returnType == constants.OBJECT:
        ret += "@"
    
    #METHOD TYPE
    if methodType == constants.INSTANCE:
        ret += "@:" # @ represents "self"
    elif methodType == constants.CLASS:
        ret += ":"
        
    #ARGUMENT TYPE
    if argumentTypes != None and type(argumentTypes) == types.TupleType:
        for argType in argumentTypes:
            if argType == constants.INTEGER:
                ret += "i"
            elif argType == constants.FLOAT:
                ret += "f"
            elif argType == constants.OBJECT:
                ret += "@"
    
    return ret